<?php
header("Content-type:text/html;charset-utf8");

$user = $_GET["username"];
$pass = $_GET["userpass"];

$conn = mysqli_connect("localhost","root","root","tencent");

if($conn){
    $sql = "select * from student where username='$user' and userpass = '$pass'" ;
    $res = mysqli_query($conn,$sql);
    $nums = mysqli_num_rows($res);
    if($nums != '0'){
        echo "1";
    }else{
        echo "0";
    }
        
    }else{
    echo "失败";
    }

?>
